package com.yangxk.kadmin.common.base;


import org.springframework.beans.factory.annotation.Autowired;

import java.io.Serializable;

public abstract class AbstractService<T,ID extends Serializable> implements BaseService<T, ID>{

    // 泛型注入
    @Autowired
    protected BaseMapper<T, ID> baseMapper;

    public int deleteByPrimaryKey(ID id){
        return baseMapper.deleteByPrimaryKey(id);
    }

    public int insert(T record){
        return baseMapper.insert(record);
    }

    public int insertSelective(T record){
        return baseMapper.insertSelective(record);
    }

    public T selectByPrimaryKey(ID id){
        return baseMapper.selectByPrimaryKey(id);
    }

    public int updateByPrimaryKeySelective(T record){
        return baseMapper.updateByPrimaryKeySelective(record);
    }

    public int updateByPrimaryKey(T record){
        return baseMapper.updateByPrimaryKey(record);
    }
}
